/**
 * Author shuqi
 * Rev
 * Date: 2020-01-01 12:19
 * <p>
 * Copyright (C) 2020 Seeyon, Inc. All rights reserved.
 * <p>
 * This software is the proprietary information of Seeyon, Inc.
 * Use is subject to license terms.
 *
 * @company seeyon.com
 * @since V5 V8.0
 * @author shuqi
 */
package com.shuqi.tools.listeners;

import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.FileEditorManagerAdapter;
import com.intellij.openapi.vfs.VirtualFile;
import com.shuqi.tools.CMPHelper;
import org.jetbrains.annotations.NotNull;

/**
 * <p></p>
 * @date 2020-01-01 12:19
 * @since V5 V8.0
 * @author shuqi
 */
public class FileOpenListener extends FileEditorManagerAdapter {
	private CMPHelper cmpHelper;
	public FileOpenListener(CMPHelper cmpHelper) {
		this.cmpHelper = cmpHelper;
	}
	@Override
	public void fileOpened(@NotNull FileEditorManager source, @NotNull VirtualFile file) {
		cmpHelper.syncFile(file.getPath());
	}
}
